function [ output_args ] = FrameRun( result )
%FRAMERUN Summary of this function goes here
%   Detailed explanation goes here
global N;
global fid;

if (~isempty(result))
    switch result(1)
        case 2
            if (length(result) == 10)
                % Save to log file
                % variable N in UartDemo file
                % |2|data: 9bytes|
                fprintf(fid,'%s\r\n' , num2str([(N*0.01) result(2:10)], ' %2.6f') );
                N = N + 1;
                % Run Kalman
                angle = KalmanRun(result(2:10)');
                % 3D plot
                Plot3D(angle);
            end
        otherwise
            disp('Invalid result');
    end
end


end

